package com.jwthhealth_pub.community.view.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jwthhealth_pub.R;
import com.jwthhealth_pub.community.view.CommunityDocReportActivity;

/**
 *  医生 申请解读报告 tag
 * Created by liuzhen on 2017/12/19.
 */

public class CommunityDocReportTagsAdapter extends RecyclerView.Adapter {
    private final CommunityDocReportActivity mActivity;
    private final String[] mData;

    public CommunityDocReportTagsAdapter(CommunityDocReportActivity communityDocReportActivity, String[] reportState) {
        this.mActivity = communityDocReportActivity;
        this.mData = reportState;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ViewHolder(View.inflate(mActivity, R.layout.item_docapply_tag, null));
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
            ViewHolder vh = (ViewHolder) holder;
            vh.tag.setText(mData[position]);
    }

    @Override
    public int getItemCount() {
        return mData.length;
    }

    private class ViewHolder extends RecyclerView.ViewHolder {

        TextView tag;

        public ViewHolder(View itemView) {
            super(itemView);

            tag = itemView.findViewById(R.id.tv_docreport_tag);
        }
    }
}
